const fs = require('fs')
const path = require('path')
const { deleteDirPromise } = require('./rmdir.js')

console.log('xxx')
;(async function () {
  const saveFolderPath = path.join(__dirname, 'versionFolder') // 这个目录用来存储新生成的版本文件
  if (fs.existsSync(saveFolderPath)) {
    // 先清空掉生成版本文件的文件夹
    await deleteDirPromise(saveFolderPath).then((res) => {
      fs.mkdirSync(saveFolderPath)
    })
  } else {
    fs.mkdirSync(saveFolderPath)
  }
})()
